﻿using System;
using System.Collections.Generic;

namespace RexToy.Cassandra
{
    class Row<K, C> : IRow<K, C>
    {
        internal Row(K key, IColumnCollection<C> collection)
        {
            key.ThrowIfNullArgument("key");
            collection.ThrowIfNullArgument("collection");

            _key = key;
            _collection = collection;
        }

        private K _key;
        public K Key
        {
            get { return _key; }
        }

        private IColumnCollection<C> _collection;
        public IColumnCollection<C> Columns
        {
            get { return _collection; }
        }

        public IColumn<C> this[C name]
        {
            get 
            {
                return _collection[name];
            }
        }
    }
}
